<!-- App.vue -->
<template>
  <div class="SHapp">
    <!-- <Dashboard></Dashboard> -->
    <main class="content">
      <PersonalInfo @click="randOpen" />
      <QuickStart></QuickStart>
    </main>
  </div>
  <div style="display: flex; justify-content: center;">
    <Sidebar />
  </div>

  <el-dialog v-model="dialogFormVisible" title="随机抽测" width="80%">
    <p>
      实现循环赛日程表利用的算法是（  ）。
    </p>
    <el-radio-group v-model = "chosenId">
      <el-radio value="1">
        A.分治策略
      </el-radio>
      <div></div>
      <el-radio value="2">
        B.动态规划法
      </el-radio>
      <el-radio value="3">
        C.贪心法
      </el-radio>
      <el-radio value="4">
        D.回溯法
      </el-radio>
    </el-radio-group>
    <template #footer>
      <div class="dialog-footer">
        <el-button v-show="!pwdShowed" type="primary" @click="create">
          提交答案
        </el-button>
      </div>
    </template>
  </el-dialog>
<!--
A、分治策略 B、动态规划法 C、贪心法 D、回溯法-->
</template>

<script setup lang="ts">
import PersonalInfo from './components/Info.vue';
import QuickStart from './components/QuickStart.vue';
import Sidebar from '@/components/Sidebar.vue'
import { ref } from 'vue'
import { ElMessage } from 'element-plus'

const dialogFormVisible = ref(false)
const chosenId = ref(0)

const randOpen = () => {
  dialogFormVisible.value = true
}

const create = () => {
  ElMessage({
    type: 'success',
    message: '答案正确'
  })
  dialogFormVisible.value = false
}

</script>

<style scoped>
.SHapp {
  display: flex;
  flex-direction: column;
}

.content {
  flex: 3;
  padding: 19px;
}

.sidebar-right {
  flex: 1;
  padding: 20px 20px 0 20px;
}
</style>
